﻿using Rhino;
using Rhino.Commands;
using System;
using YangTools.Realization;

namespace YangTools
{
    public class AutoAreaReassociateCommand : Command
    {
        static AutoAreaReassociateCommand _instance;
        public AutoAreaReassociateCommand()
        {
            _instance = this;
        }

        ///<summary>The only instance of the AutoAreaReassociateTextAndCurves command.</summary>
        public static AutoAreaReassociateCommand Instance
        {
            get { return _instance; }
        }

        public override string EnglishName
        {
            get { return "ReassociateTextAndCurves"; }
        }

        /// <summary>
        /// 重新链接面积文字与封闭图形
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="mode"></param>
        /// <returns></returns>
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            var ar = new AutoAreaRectangle();
            ar.Reassociate();
            return Result.Success;
        }
    }
}